package collection;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/12 10:27
 */
public class CollectionDemo3 {
    public static void main(String[] args) {
        Collection c=new ArrayList();
        Point p=new Point(1,2);
        c.add(p);//将P添加到集合C中——————将引用地址装到了C中
        System.out.println(p);
        System.out.println(c);
        p.setX(100);
        System.out.println(p);
        System.out.println(c);
    }
}
